#include <stdio.h>

int main ()
{
	double x;
	double a, v = 1, derived = 0, value = 0;
	register int i=0, d = 1;

	scanf("%lf", &x);
	if (x == 0.0) {
		d = 0;
	}
	while (scanf("%lf", &a) == 1) {
		value += v * a;
		if (d == 0) {
			if (i == 1) {
				derived += a;
			}
		} else {
			derived += i * (v / x) * a;
		}
		v *= x;
		++i;
	}
	printf("%lf %lf\n", value, derived);
	return 0;
}
